<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="icon" href="/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <title>涨幅情况汇总</title>
    <script src="https://img.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
    <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
    <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
    <script src="https://img.hcharts.cn/highcharts/modules/data.js"></script>
    <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
</head>
<body>

<div id="columnContainer" style="max-width:450px;height:400px"></div>

<br/><br/>
<br/><br/>

<div id="pieContainer" style="max-width:600px;height:600px"></div>

<div class="message">

</div>
<script>
    $(document).ready(function () {
        var optionsPie = {
            chart: {
                renderTo: 'pieContainer',
                type: 'pie'
            },
            title: {
                text: '个股涨幅情况汇总',
            },
            tooltip: {
                pointFormat: '{point.y}个，占比 {point.percentage:.1f} %'
            },
            accessibility: {
                point: {
                    valueSuffix: '%'
                }
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        format: '<b>{point.name}</b>:<br></br> {point.y}个，占比 {point.percentage:.1f} %'
                    }
                }
            },
            series: [
                {
                    name: '涨幅区间',
                    colorByPoint: true
                }]
        };

        var optionsColumn = {
            chart: {
                renderTo: 'columnContainer',
                type: 'column'
            },
            title: {
                text: '主要指数最近一年涨幅'
            },
            subtitle: {
                text: ''
            },
            xAxis: {
                type: 'category',
                labels: {
                    rotation: 0,
                    style: {
                        fontSize: '13px',
                        fontFamily: 'Verdana, sans-serif'
                    }
                }
            },
            yAxis: {
                min: 0,
                title: {
                    text: '涨幅'
                }
            },
            legend: {
                enabled: false
            },
            tooltip: {
                pointFormat: '涨幅 <b>{point.y:.1f}%</b>'
            },
            series: [{
                name: 'indexIncrease',
                dataLabels: {
                    enabled: true,
                    rotation: -90,
                    color: '#FFFFFF',
                    align: 'right',
                    format: '{point.y:.1f} %', // one decimal
                    y: 10, // 10 pixels down from the top
                    style: {
                        fontSize: '13px',
                        fontFamily: 'Verdana, sans-serif'
                    }
                }
            }]
        };


        $.getJSON('statistics/increaseRangeStatistics', function (data) {
            optionsColumn.series[0].data = data.indexChart;
            optionsPie.series[0].data = data.stockChart;
            var chart1 = new Highcharts.Chart(optionsColumn);
            var chart2 = new Highcharts.Chart(optionsPie);

        });
    });
</script>

</body>
</html>